using System;

namespace LS.Digitize
{
    public interface IWriter
    {
        int Deepth { get; }
        void StartWriteFile();
        void EndWriteFile();
        void StartWriteObject();
        void EndWriteObject();
        void StartWriteProperty(string name);
        void EndWriteProperty(string name);
        void StartWriteCollection();
        void EndWriteCollection();
        void StartWriteCollectionItem(int index);
        void EndWriteCollectionItem(int index);
        void StartWriteDictionary();
        void EndWriteDictionary();
        void StartWriteDictionaryKey(int index);
        void EndWriteDictionaryKey(int index);
        void StartWriteDictionaryValue(int index);
        void EndWriteDictionaryValue(int index);

        /// <summary>
        /// 写入null
        /// </summary>
        void WriteNull();
        void WritePrimitive(string value);
        void WritePrimitive(char value);
        void WritePrimitive(bool value);
        void WritePrimitive(short value);
        void WritePrimitive(ushort value);
        void WritePrimitive(int value);
        void WritePrimitive(uint value);
        void WritePrimitive(long value);
        void WritePrimitive(ulong value);
        void WritePrimitive(float value);
        void WritePrimitive(double value);
        void WritePrimitive(decimal value);
        void WritePrimitive(byte value);
        void WritePrimitive(sbyte value);
        void WritePrimitive(byte[] value);
    }
}